package com.ktgj.flight.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.flight.mapper.AirportTerminalMapper;
import com.ktgj.flight.domain.AirportTerminal;
import com.ktgj.flight.service.IAirportTerminalService;

/**
 * 航站楼Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class AirportTerminalServiceImpl implements IAirportTerminalService 
{
    @Autowired
    private AirportTerminalMapper airportTerminalMapper;

    /**
     * 查询航站楼
     * 
     * @param terminalId 航站楼ID
     * @return 航站楼
     */
    @Override
    public AirportTerminal selectAirportTerminalById(Long terminalId)
    {
        return airportTerminalMapper.selectAirportTerminalById(terminalId);
    }

    /**
     * 查询航站楼列表
     * 
     * @param airportTerminal 航站楼
     * @return 航站楼
     */
    @Override
    public List<AirportTerminal> selectAirportTerminalList(AirportTerminal airportTerminal)
    {
        return airportTerminalMapper.selectAirportTerminalList(airportTerminal);
    }

    /**
     * 新增航站楼
     * 
     * @param airportTerminal 航站楼
     * @return 结果
     */
    @Override
    public int insertAirportTerminal(AirportTerminal airportTerminal)
    {
        airportTerminal.setCreateTime(DateUtils.getNowDate());
        return airportTerminalMapper.insertAirportTerminal(airportTerminal);
    }

    /**
     * 修改航站楼
     * 
     * @param airportTerminal 航站楼
     * @return 结果
     */
    @Override
    public int updateAirportTerminal(AirportTerminal airportTerminal)
    {
        return airportTerminalMapper.updateAirportTerminal(airportTerminal);
    }

    /**
     * 批量删除航站楼
     * 
     * @param terminalIds 需要删除的航站楼ID
     * @return 结果
     */
    @Override
    public int deleteAirportTerminalByIds(Long[] terminalIds)
    {
        return airportTerminalMapper.deleteAirportTerminalByIds(terminalIds);
    }

    /**
     * 删除航站楼信息
     * 
     * @param terminalId 航站楼ID
     * @return 结果
     */
    @Override
    public int deleteAirportTerminalById(Long terminalId)
    {
        return airportTerminalMapper.deleteAirportTerminalById(terminalId);
    }

    @Override
    public String queryStartTerminal(Long terminalId) {
        return airportTerminalMapper.queryStartTerminal(terminalId);
    }

    /**
     * 获取航站楼id
     * */
    @Override
    public AirportTerminal selectAirportTerminalByName(String name) {
        airportTerminalMapper.selectAirportTerminalByName(name);
        return null;
    }
}
